选择有意义。但是有人可以向我解释.detect吗?我不明白这些数据。>>[1,2,3,4,5,6,7].detect{|x|x.between?(3,4)}=>3>>[1,2,3,4,5,6,7].detect{|x|x.between?(3,6)}=>3>>[1,2,3,4,5,6,7].detect{|x|x.between?(3,7)}=>3>>[1,2,3,4,5,6,7].detect{|x|x.between?(2,7)}=>2>>[1,2,3,4,5,6,7].detect{|x|x.between?(1,7)}=>1>>[1,2,3,4,5,6,7].detect{|x
我对Rails有点陌生,我正在尝试创建一个用户登录。我通过教程找到了here.最后它让我为批量分配添加“attr_accessible”。但是,当我这样做时,出现以下错误:undefinedmethod`attr_accessible'for#我看到了这个post我需要classUsertrue,:uniqueness=>true,:length=>{:in=>3..20}validates:email,:presence=>true,:uniqueness=>true,:format=>EMAIL_REGEXvalidates:password,:confirmation=>true